apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: request-header-modifier
  namespace: gateway-conformance-infra
spec:
  parentRefs:
  - name: same-namespace
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /set
    filters:
    - type: RequestHeaderModifier
      requestHeaderModifier:
        set:
        - name: X-Header-Set
          value: set-overwrites-values
    backendRefs:
    - name: infra-backend-v1
      port: 8080
  - matches:
    - path:
        type: PathPrefix
        value: /add
    filters:
    - type: RequestHeaderModifier
      requestHeaderModifier:
        add:
        - name: X-Header-Add
          value: add-appends-values
    backendRefs:
    - name: infra-backend-v1
      port: 8080
  - matches:
    - path:
        type: PathPrefix
        value: /remove
    filters:
    - type: RequestHeaderModifier
      requestHeaderModifier:
        remove:
        - X-Header-Remove
    backendRefs:
    - name: infra-backend-v1
      port: 8080
  - matches:
    - path:
        type: PathPrefix
        value: /multiple
    filters:
    - type: RequestHeaderModifier
      requestHeaderModifier:
        set:
        - name: X-Header-Set-1
          value: header-set-1
        - name: X-Header-Set-2
          value: header-set-2
        add:
        - name: X-Header-Add-1
          value: header-add-1
        - name: X-Header-Add-2
          value: header-add-2
        - name: X-Header-Add-3
          value: header-add-3
        remove:
        - X-Header-Remove-1
        - X-Header-Remove-2
    backendRefs:
    - name: infra-backend-v1
      port: 8080
  - matches:
    - path:
        type: PathPrefix
        value: /case-insensitivity
    filters:
    - type: RequestHeaderModifier
      requestHeaderModifier:
        set:
        - name: X-Header-Set
          value: header-set
        add:
        - name: X-Header-Add
          value: header-add
        remove:
        - X-Header-Remove
    backendRefs:
    - name: infra-backend-v1
      port: 8080
